package io.zpy.service;

import com.alibaba.fastjson.JSONObject;
import io.zpy.entity.PushOrder;
import io.zpy.quartz.ScheduleJob;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 *
 * @author wuyifan
 * @date 2020/5/13
 */
public interface TrackTopicsService {
    /**
     * 根据用户id查询个人推送订单
     * @param uid 用户id
     * @return Result<ResponseTemplate>
     */
    public JSONObject getOwnPushOrders(@Param("uid") String uid);

    /**
     * 定时任务
     * @param sj
     */
    public String quartzJob(ScheduleJob sj);

    /**
     * 根据订单id查询个人推送订单
     * @param pid 订单id
     * @return Result<ResponseTemplate>
     */
    public List<PushOrder> getPushOrderByPid(@Param("uid") String uid, @Param("pid") String pid);

    /**
     * 修改个人推送订单
     * @param po
     * @return
     */
    public int editPushOrder(PushOrder po) throws Exception;

    /**
     * 删除个人推送订单
     * @param pid
     * @return
     */
    public int delPushOrder(Integer pid) throws Exception;

    /**
     * 增加个人推送订单
     * @param po
     * @return
     */
    public int addPushOrder(PushOrder po) throws Exception;

    /**
     * 服务启动执行定时器
     */
    public void runAllJobs() throws Exception;

    void quartzJobTest(ScheduleJob sj);

}
